# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=grilo-plugins
pkgver=0.3.5
pkgrel=1
pkgdesc="A collection of plugins for the Grilo framework"
url="https://git.gnome.org/browse/grilo-plugins"
arch=(i686 x86_64)
license=(LGPL)
depends=(grilo lua libmediaart libgdata tracker gom libdmapsharing chromaprint gst-plugins-bad
         gmime3)
makedepends=(git meson gperf)
checkdepends=(gst-plugins-good gst-plugins-base)
optdepends=('dleyna-server: DLNA plugin'
            'tracker-miners: Tracker plugin')
groups=(gnome)
_commit=ec1c807ae0a3d1f2f5ca12c3147e053d1f0bddd1  # tags/grilo-plugins-0.3.5^0
source=("git+https://git.gnome.org/browse/grilo-plugins#commit=$_commit"
        luafiles.diff)
sha256sums=('SKIP'
            '73b388d9564ae8c1d3f464831082acffd46b35bdc85a3a8bdb25f408f9c6dc48')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^grilo-plugins-//;s/-/+/g'
}

prepare() {
  mkdir build
  cd $pkgname
  patch -Np1 -i ../luafiles.diff
}

build() {
  cd build
  export LANG=en_US.UTF-8
  meson setup --prefix=/usr --buildtype=release ../$pkgname
  ninja
}

check() {
  cd build
  # Unreliable tests using websites...
  meson test || :
}

package() {
  cd build
  DESTDIR="$pkgdir" ninja install
}
